#ifndef MYTITLEBAR_H
#define MYTITLEBAR_H

#include <QWidget>
#include <QPushButton>
QT_BEGIN_NAMESPACE
class QButtonGroup;
class QHBoxLayout;
QT_END_NAMESPACE
class MyTitleBar : public QWidget
{
    Q_OBJECT

public:
    explicit MyTitleBar(QWidget *parent = nullptr);
    ~MyTitleBar();
    void addTitleBar();
signals:
    void minimize();
    void toggleMaximize();
    void close();
    void sigAddWeb();
private:
    void resizeTtitle();
private:
    QHBoxLayout     *m_pMainlayout;
    QButtonGroup    *m_pBtnGroup;
    QPushButton     *m_pAddBtn;
    QPushButton     *m_pminimizeButton;
    QPushButton     *m_pmaximizeButton;
    QPushButton     *m_pcloseButton;
};

class MyBtnBarTitle : public QPushButton
{
    Q_OBJECT
public:
    explicit MyBtnBarTitle(QWidget *parent = nullptr);
    ~MyBtnBarTitle();
    void setTitleText(const QString& strTitle);
protected:
    // void paintEvent(QPaintEvent* event) override;
private:
    QString  m_qsTitle;
};
#endif // MYTITLEBAR_H
